/**
 * 
 */
package jmine.tec.report.impl;

import java.util.Map;

import jmine.tec.report.ExecutableDataColumn;
import jmine.tec.report.cell.DataCell;

/**
 * @author takeshi
 * @version 24/08/2007
 */
public class SimpleExecutableDataRow extends AbstractExecutableDataRow {

    private static final long serialVersionUID = 7084369017720026326L;

    private final Object relatedObject;

    /**
     * C'tor
     * 
     * @param related the related object
     */
    public SimpleExecutableDataRow(final Object related) {
        super(related.toString());
        this.relatedObject = related;
    }

    /**
     * C'tor
     * 
     * @param name the name data cell
     * @param related the related object
     */
    public SimpleExecutableDataRow(final DataCell name, final Object related) {
        super(name);
        this.relatedObject = related;
    }

    /**
     * @param column the column
     * @param params the params
     * @see br.com.maps.util.report.ExecutableDataRow#execute(br.com.maps.util.report.ExecutableDataColumn, java.util.Map)
     */
    @Override
    public void execute(final ExecutableDataColumn column, final Map<String, Object> params) {
        column.executeByObjectType(this.relatedObject.getClass(), this, params);
    }

    /**
     * @return {@link Object}
     * @see br.com.maps.util.report.ExecutableDataRow#getRelatedObject()
     */
    public Object getRelatedObject() {
        return this.relatedObject;
    }

}
